# -*- ecoding: utf-8 -*-
# @Author: Wick
# @Time: 2024-02-24 17:46

# def sum_numbers(num):
#     print(num)
#     # 递归的出口很重要，否则会出现死循环
#     if num == 1:
#         return
#     sum_numbers(num - 1)
# sum_numbers(3)

def sum_numbers(num):
    if num == 1:
        return 1
    return num + sum_numbers(num-1)

print(sum_numbers(10))